<?php
class LexComponent extends Object {
/**
 * Actions used to fetch the post data
 *
 * Maps the action that takes the post data and processes it by using this 
 * component and maps it to another action that is accessed by a redirect which
 * has the post data attached as get data now
 *
 * array('search' => 'results');
 * array('search' => array('controller' => 'results');
 *
 * @var array actions
 * @access public
 */
	public $actions = array();

/**
 * Intialize Callback
 *
 * @param object Controller object
 * @access public
 */
	public function initialize(&$controller) {
		$this->controller = $controller;
	}
	
	public function get($params=null){
		$params = array_merge(array(),$params);
		$this->ViewOffer =& $this->getModel('ViewOffer');
		if(!$this->ViewOffer){
			return false;
		}
		 
		$joins = array();
		$this->ViewOffer->recursive = 0;
		return $this->ViewOffer->find('all',$params); 
	}
	
	public function typy(){
		$this->Typ =& $this->getModel('Typ');
		if(!$this->Typ){
			return false;
		}
		$this->Typ->recursive = 0;
		return $this->Typ->find('list',array('id','name'));
	}
	
	public function transakcje(){
		$this->Transakcja =& $this->getModel('Transakcja');
		if(!$this->Transakcja){
			return false;
		}
		$this->Transakcja->recursive = 0;
		return $this->Transakcja->find('list',array('id','name'));
	}
	
	function &getModel($name = null) {
		$model = null;
		if (!$name) {
			$name = 'ProductKoszulki';
		}
		if($name){
			if (PHP5) {
				$model = ClassRegistry::init($name);
			} else {
				$model =& ClassRegistry::init($name);
			}
	
			if (empty($model)) {
				//				$this->_error('FileUpload::getModel() - Model is not set or could not be found');
				return null;
			}
		}
		return $model;
	}

}
?>